<include file="Public/head_top"/>
<script src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>

<body>
    <input type="hidden" name="deleteURL" id="deleteURL" value="__URL__/deleteSchoolInfo">
    <input type="hidden" name="editorURL" id="editorURL" value="__URL__/editorSchoolInfo">
    <input type="hidden" name="addURL" id="addURL" value="__URL__/addSchoolInfo">
    <input type="hidden" name="school_id" id="school_id" value="{$Think.get.school_id}">
    <div class="content">
        
        <div class="tab-content">
            <div class="biaoge tab-item actived" id="tab-item-baseinfo">
                <form action="__URL__/memberAction" enctype="multipart/form-data" method="post" >
                    <input type="hidden" name="uid" value="{$Think.get.uid}">
                    
                    <div class="tab-box" style="margin-top: 30px;">
                        <div class="title-bar">
                            <p>基础信息</p>
                        </div>
                        <dl class="clearfix">
                            <dt>用户昵称</dt>
                            <dd class="samll-dd">
                                <input type="text" value="{$info.nickname}" name="nickname">
                            </dd>
                            <dt>用户密码</dt>
                            <dd  class="samll-dd" >
                                <input type="password" name="password" value="">如果不修改密码请不要填写
                                
                            </dd>
                            <dt>出生日期</dt>
                            <dd  class="samll-dd" >
                                <input type="text" value="{$info.birthday}" name="birthday" onClick="WdatePicker()">
                            </dd>
                            <dt>qq号码</dt>
                            <dd class="samll-dd" >     
                               <input type="text" value="{$info.qq}" name="qq">
                            </dd>
                            <dt>手机号码</dt>
                            <dd  class="samll-dd" >
                                <input type="text" value="{$member.mobile}" name="mobile" >
                            </dd>
                            <dt>邮箱号码</dt>
                            <dd class="samll-dd" >     
                               <input type="text" value="{$member.email}" name="email">
                            </dd>
                            <dt>用户积分</dt>
                            <dd class="samll-dd" >
                                <input type="text"  name="score" value="{$info.score}">
                            </dd>
                            <dt>会员状态</dt>
                            <dd class="samll-dd" >
                                <input type="radio" name="status" value='1'    <eq name="info.status" value="1">   checked  </eq>   >开启
                               <input type="radio" name="status" value='0'  <eq name="info.status" value="0">   checked  </eq>>禁止
                            </dd>
                            <dt>用户类型</dt>
                            <dd class="samll-dd">
                                
                               <select name="teacher_type">
                                   <option value="0" <eq name="info.teacher_type" value="0">   selected  </eq>>普通用户</option>
                                   <option value="1" <eq name="info.teacher_type" value="1">   selected  </eq>>教师</option>
                                </select>

                            </dd>
                            <dt >用户性别</dt>
                            <dd class="samll-dd" >
                                 <input type="radio" name="sex" value='0' <eq name="info.sex" value="0">   checked  </eq>>女
                               <input type="radio" name="sex" value='1' <eq name="info.sex" value="1">   checked  </eq>>男
                            </dd>

                            <dt style="display: none;">所属学校</dt>
                            <dd id="user-school" style="display: none;position: relative;" >
                                <input type="hidden" name="school_id" value="{$school_data.school_id}">
                                <input type="text" name="school_name" id="" class="input_tips"value="{$school_data.school_name}">
                                <ul class="input_tips_box" style="z-index:1;display:none;height:160px;overflow:hidden;margin-left:0px;text-align: left;padding: 5px 2px 5px 10px;background-color: #ddd;width: 178px;left: 0;top: 48px;">
                                </ul>
<!--                                 <select name="school_id" >
                                   <option value="0" >管理员</option>
                                    <volist name="school_name" id="vo">
                                        <option value="{$vo.school_id}"  <if condition="$vo.school_id eq $info.school_id ">selected</if> >
                                            {$vo.school_name}
                                        </option>
                                    </volist>
                                </select>  -->
                            </dd>
                        </dl>
                    </div>
                    
                    <div class="btn-group">
                        <input type="submit" value="保存">
                    </div>
                </form>
            </div>
        </div>
    </div>
   <div id="modal">
       <div class="modal-overlay"></div>
       <div class="modal-box" id="modal-change-password">
           <div class="modal-header">
               <h2>修改密码</h2>
           </div>
           <div class="modal-content">
               
           </div>
           <div class="modal-footer">
               <a class="btn-cancel modal-btn">取消</a>
               <input type="submit" value="确定"  class="btn-submit-2 modal-btn">
           </div>
       </div>
   </div>
    <script>
        var $userType = $('.samll-dd select[name=teacher_type]');
        judgeUserType();
        $userType.on('change', judgeUserType);
        function judgeUserType() {
            if ( $userType.val() == 0 ) {
                $('#user-school').hide();
                $('#user-school').prev().hide();
                $('#user-school').find('input[name=school_id]').val("0");
                $('#user-school').find('input[name=school_name]').val("");
            }else if($userType.val() == 1 ){
                $('#user-school').show();
                $('#user-school').prev().show();
            }
        }
        //模拟下拉框
        $('.input_tips').on('paste', function() {
               // var $that =  $(this);
               //getlist($that);
        }).on('keyup', function(event) {
                var $that =  $(this);
                getlist($that);
        }).on('blur', function(event) {
        }).on('focus', function(event) {
             var $that =  $(this);
             getlist($that);
           $(this).parent().find('ul.input_tips_box').show();
        });
        $('.input_tips_box').on('click','.chenge',function() {
            //alert($(this).attr('alt') + $(this).attr('title'));
            $(this).closest('div').find("input[name=school_name]").val($(this).attr('title'));
            $(this).closest('div').find("input[name=school_id]").val($(this).attr('alt'));
            $(this).closest('div').find('ul.input_tips_box').hide();
        });
        function getlist($that){
            var school_name=$that.val();
            var html =  '';
            $.ajax({
                url:'__MODULE__/Article/getSchoolName',
                async:false,
                type:'GET',
                data:{'school_name':school_name},
                dataType:'json',
                    success: function(data){
                        if(data !== null){
                            var j=1;
                            $.each(data,function(i,n){ 
                                if(j<6){
                                    html+="<li><a href='javascript:void(0)' class='chenge' alt='"+i+"' title='"+n+"'>"+n+"</a></li>";  
                                }
                                j++;
                             }); 
                        }
                        
                    }
                });
            $that.parent().find('ul.input_tips_box >li').remove();  
            $that.parent().find('.input_tips_box').append(html);
        }
    </script>
</body>
</html>